<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>项目自测完全指南</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
        }
        .serif-font {
            font-family: 'Noto Serif SC', serif;
        }
        .gradient-text {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
        }
        .code-block {
            background: #1e1e1e;
            color: #d4d4d4;
            border-radius: 8px;
            overflow-x: auto;
        }
        .code-block pre {
            margin: 0;
            padding: 1.5rem;
        }
        .drop-cap {
            float: left;
            font-size: 4rem;
            line-height: 1;
            font-weight: 700;
            margin-right: 0.5rem;
            margin-top: -0.2rem;
            color: #667eea;
        }
        .section-number {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 2.5rem;
            height: 2.5rem;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border-radius: 50%;
            font-weight: 700;
            margin-right: 1rem;
        }
        .mermaid {
            display: flex;
            justify-content: center;
            margin: 2rem 0;
        }
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        .animate-fadeInUp {
            animation: fadeInUp 0.8s ease-out;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="relative bg-gradient-to-br from-purple-900 via-purple-700 to-indigo-800 text-white overflow-hidden">
        <div class="absolute inset-0 bg-black opacity-20"></div>
        <div class="relative container mx-auto px-6 py-24 text-center">
            <h1 class="text-5xl md:text-7xl font-bold mb-6 animate-fadeInUp">
                项目自测完全指南
            </h1>
            <p class="text-xl md:text-2xl mb-8 opacity-90 max-w-3xl mx-auto animate-fadeInUp" style="animation-delay: 0.2s;">
                <span class="drop-cap serif-font">在</span>项目开发过程中，自测是确保代码质量和功能完整性的重要环节。掌握全面的测试策略，构建可靠的软件系统。
            </p>
            <div class="flex justify-center space-x-4 animate-fadeInUp" style="animation-delay: 0.4s;">
                <div class="bg-white bg-opacity-20 backdrop-blur-sm rounded-lg px-6 py-3">
                    <i class="fas fa-check-circle mr-2"></i>10种测试类型
                </div>
                <div class="bg-white bg-opacity-20 backdrop-blur-sm rounded-lg px-6 py-3">
                    <i class="fas fa-tools mr-2"></i>专业工具推荐
                </div>
                <div class="bg-white bg-opacity-20 backdrop-blur-sm rounded-lg px-6 py-3">
                    <i class="fas fa-code mr-2"></i>实战代码示例
                </div>
            </div>
        </div>
    </section>

    <!-- Testing Overview Visualization -->
    <section class="container mx-auto px-6 py-16">
        <div class="bg-white rounded-2xl shadow-xl p-8">
            <h2 class="text-3xl font-bold text-center mb-8 gradient-text">测试体系全景图</h2>
            <div class="mermaid">
                graph TD
                    A[项目自测体系] --> B[单元测试]
                    A --> C[集成测试]
                    A --> D[端到端测试]
                    A --> E[性能测试]
                    A --> F[安全测试]
                    A --> G[回归测试]
                    A --> H[烟雾测试]
                    A --> I[用户验收测试]
                    A --> J[测试覆盖率]
                    A --> K[测试用例管理]
                    
                    B --> B1[JUnit]
                    B --> B2[Mockito]
                    B --> B3[TestNG]
                    
                    C --> C1[Spring Boot Test]
                    C --> C2[Arquillian]
                    
                    D --> D1[Selenium]
                    D --> D2[Cypress]
                    
                    E --> E1[JMeter]
                    E --> E2[Gatling]
                    
                    F --> F1[OWASP ZAP]
                    F --> F2[Burp Suite]
                    
                    J --> J1[JaCoCo]
                    J --> J2[Cobertura]
                    
                    K --> K1[TestRail]
                    K --> K2[JIRA]
                    
                    style A fill:#667eea,stroke:#fff,stroke-width:3px,color:#fff
                    style B fill:#f59e0b,stroke:#fff,stroke-width:2px,color:#fff
                    style C fill:#10b981,stroke:#fff,stroke-width:2px,color:#fff
                    style D fill:#3b82f6,stroke:#fff,stroke-width:2px,color:#fff
                    style E fill:#ef4444,stroke:#fff,stroke-width:2px,color:#fff
                    style F fill:#8b5cf6,stroke:#fff,stroke-width:2px,color:#fff
                    style G fill:#06b6d4,stroke:#fff,stroke-width:2px,color:#fff
                    style H fill:#ec4899,stroke:#fff,stroke-width:2px,color:#fff
                    style I fill:#14b8a6,stroke:#fff,stroke-width:2px,color:#fff
                    style J fill:#f97316,stroke:#fff,stroke-width:2px,color:#fff
                    style K fill:#6366f1,stroke:#fff,stroke-width:2px,color:#fff
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <section class="container mx-auto px-6 py-8">
        <div class="grid gap-8">
            
            <!-- 1. 单元测试 -->
            <div class="bg-white rounded-2xl shadow-lg p-8 card-hover">
                <div class="flex items-center mb-6">
                    <span class="section-number">1</span>
                    <h2 class="text-3xl font-bold">单元测试</h2>
                </div>
                
                <div class="grid md:grid-cols-2 gap-6 mb-6">
                    <div>
                        <h3 class="text-xl font-semibold mb-3 text-purple-700">
                            <i class="fas fa-info-circle mr-2"></i>定义
                        </h3>
                        <p class="text-gray-700 leading-relaxed">
                            单元测试是对软件系统中最小可测试单元（通常是类或函数）进行的测试，目的是验证每个单元是否按预期工作。
                        </p>
                    </div>
                    
                    <div>
                        <h3 class="text-xl font-semibold mb-3 text-purple-700">
                            <i class="fas fa-tools mr-2"></i>工具和框架
                        </h3>
                        <div class="space-y-2">
                            <div class="flex items-center">
                                <i class="fas fa-check text-green-500 mr-2"></i>
                                <span><strong>JUnit</strong>：广泛使用的Java单元测试框架</span>
                            </div>
                            <div class="flex items-center">
                                <i class="fas fa-check text-green-500 mr-2"></i>
                                <span><strong>Mockito</strong>：用于模拟对象和依赖</span>
                            </div>
                            <div class="flex items-center">
                                <i class="fas fa-check text-green-500 mr-2"></i>
                                <span><strong>TestNG</strong>：支持并行测试等高级功能</span>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="mb-6">
                    <h3 class="text-xl font-semibold mb-3 text-purple-700">
                        <i class="fas fa-lightbulb mr-2"></i>最佳实践
                    </h3>
                    <ul class="space-y-2 text-gray-700">
                        <li class="flex items-start">
                            <i class="fas fa-arrow-right text-purple-500 mr-2 mt-1"></i>
                            <span>编写测试用例来验证函数和方法的正确性</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-arrow-right text-purple-500 mr-2 mt-1"></i>
                            <span>使用Mock对象隔离被测试单元的外部依赖</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-arrow-right text-purple-500 mr-2 mt-1"></i>
                            <span>确保测试用例覆盖所有可能的代码路径</span>
                        </li>
                    </ul>
                </div>
                
                <div class="code-block">
                    <pre><code>// 使用JUnit进行单元测试示例
@Test
public void testAdd() {
    Calculator calculator = new Calculator();
    assertEquals(5, calculator.add(2, 3));
}</code></pre>
                </div>
            </div>

            <!-- 2. 集成测试 -->
            <div class="bg-white rounded-2xl shadow-lg p-8 card-hover">
                <div class="flex items-center mb-6">
                    <span class="section-number">2</span>
                    <h2 class="text-3xl font-bold">集成测试</h2>
                </div>
                
                <div class="grid md:grid-cols-2 gap-6 mb-6">
                    <div>
                        <h3 class="text-xl font-semibold mb-3 text-green-700">
                            <i class="fas fa-info-circle mr-2"></i>定义
                        </h3>
                        <p class="text-gray-700 leading-relaxed">
                            集成测试关注于系统中多个组件或模块之间的交互。它的目标是验证这些组件在一起时的行为是否符合预期。
                        </p>
                    </div>
                    
                    <div>
                        <h3 class="text-xl font-semibold mb-3 text-green-700">
                            <i class="fas fa-tools mr-2"></i>工具和框架
                        </h3>
                        <div class="space-y-2">
                            <div class="flex items-center">
                                <i class="fas fa-check text-green-500 mr-2"></i>
                                <span><strong>Spring Boot Test</strong>：测试Spring Boot应用程序</span>
                            </div>
                            <div class="flex items-center">
                                <i class="fas fa-check text-green-500 mr-2"></i>
                                <span><strong>Arquillian</strong>：集成测试的容器管理工具</span>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="mb-6">
                    <h3 class="text-xl font-semibold mb-3 text-green-700">
                        <i class="fas fa-lightbulb mr-2"></i>最佳实践
                    </h3>
                    <ul class="space-y-2 text-gray-700">
                        <li class="flex items-start">
                            <i class="fas fa-arrow-right text-green-500 mr-2 mt-1"></i>
                            <span>测试模块之间的接口和交互，确保数据和控制流的正确性</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-arrow-right text-green-500 mr-2 mt-1"></i>
                            <span>使用嵌入式数据库（如H2）或测试数据库执行测试</span>
                        </li>
                    </ul>
                </div>
                
                <div class="code-block">
                    <pre><code>// 使用Spring Boot Test进行集成测试示例
@RunWith(SpringRunner.class)
@SpringBootTest
public class UserServiceIntegrationTest {
    
    @Autowired
    private UserService userService;
    
    @Test
    public void testCreateUser() {
        User user = new User("John", "Doe");
        User savedUser = userService.createUser(user);
        assertNotNull(savedUser.getId());
    }
}</code></pre>
                </div>
            </div>

            <!-- 3. 端到端测试 -->
            <div class="bg-white rounded-2xl shadow-lg p-8 card-hover">